/**
 * @license
 * Copyright Akveo. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@import './button-filled';
@import './button-outline';
@import './button-ghost';
@import './button-hero';

@mixin nb-buttons-theme() {
  [nbButton] {
    cursor: nb-theme(button-cursor);
    font-family: nb-theme(button-text-font-family);
    font-weight: nb-theme(button-text-font-weight);

    &:focus {
      outline: none;
      @include nb-outline(nb-theme(button-outline-width), nb-theme(button-outline-color));
    }

    &[disabled] {
      cursor: nb-theme(button-disabled-cursor);
    }

    @each $size in nb-get-sizes() {
      &.size-#{$size} {
        font-size: nb-theme(button-#{$size}-text-font-size);
        line-height: nb-theme(button-#{$size}-text-line-height);

        nb-icon {
          font-size: nb-theme(button-#{$size}-text-font-size);
          height: nb-theme(button-#{$size}-icon-size);
          width: nb-theme(button-#{$size}-icon-size);
        }

        $icon-offset: nb-theme(button-#{$size}-icon-offset);
        &.icon-start:not(.icon-end) nb-icon {
          @include nb-ltr(margin-right, $icon-offset);
          @include nb-rtl(margin-left, $icon-offset);
        }
        &.icon-end:not(.icon-start) nb-icon {
          @include nb-ltr(margin-left, $icon-offset);
          @include nb-rtl(margin-right, $icon-offset);
        }
      }
    }

    @each $shape in nb-get-shapes() {
      &.shape-#{$shape} {
        border-radius: nb-theme(button-#{$shape}-border-radius);
      }
    }
  }

  a[nbButton] {
    text-decoration: none;
  }

  @include button-filled;
  @include button-outline;
  @include button-ghost;
  @include button-hero;
}
